Ext.require(['AM.component.menu.StartMenu',
    'AM.service.Start',
    'AM.service.Insert',
    'AM.component.menu.InsertMenu',
    'AM.component.menu.FileMenu',
    'AM.service.PlayCSS'
]);


Ext.define("AM.view.Layout", {
    doLayout:function () {
        window.ppt = window.ppt || Ext.create("AM.PPT");
        var menu = null;
        var fileMenu = AM.component.menu.FileMenu.getInstance();
        var startMenu = AM.component.menu.StartMenu.getInstance();
        var animMenu = null;
        var insertMenu = AM.component.menu.InsertMenu.getInstance();

        var thumbnails = null;
        var workspace = null;
        var property = null;




        menu = Ext.widget("tabpanel", {region:'north', width:450,
            height:100,
            activeTab:0,
            region:'north',
            defaults:{
                bodyPadding:10
            },
            split:true,
            items:[
                fileMenu,
                startMenu,
                insertMenu,
                {
                    title:'幻灯片放映',
                    items:[
                        {
                            text:'放映',

                            handler:function(){
                                AM.service.PlayCSS.begin(0)
                            },
                            xtype:'button'
                        },
                        {
                            text:'当前开始',
                            handler:function () {
                                AM.service.PlayCSS.begin(ppt.index)
                            },
                            xtype:'button'
                        }
                    ]
                }
            ]
        });


        thumbnails = Ext.widget("panel", {region:'west', autoScroll:true,
            title:'缩略图',
            collapsible:true,
            width:'20%'
        });
        workspace = Ext.widget('container', {region:'center',
            layout:'fit',
            width:'80%',
            height: '100%',
            style:{
                backgroundColor:'#fff'
            }});
        property = Ext.widget('panel', {region:'east', autoScroll:true,
            title:'属性',
            width: '20%',
            collapsible:true,
            collapsed:true
        })

        Ext.create('Ext.container.Viewport', {
            layout:'border',
            items:[menu, thumbnails, workspace, property]
        });

        ppt.view.menu = menu;
        ppt.view.thumbnails = thumbnails;
        ppt.view.workspace = workspace;
        ppt.view.property = property;
    }
})
;